/* ImageStudio ARexx script **************************************/ /* generate HTML thumbnail image index files */ /* V1.0 2 Nov 97 by James Perrin */ /* V2.0 19 Nov 97 added ability to update an index if new images */ /* have been added to the directory */ /* V2.1 24 May 98 added skipping of files unable to load eg progressive jpegs */ /* V2.1D 25 May 98 added thumbnail dimension gernation, split development into two scripts */ /* V3.0 25 June 98added max table rows => multiple HTML file generation */ /* V3.1 20 Jan 99 add constant for file args. Second public release */ /* Allow commands to return results */ options results /* On error, goto ERROR:. Comment out this line if you wish to */ /* perform your own error checking. */ signal on error /* BEGIN PROGRAM *************************************************/ /* PROGRAM CONSTANTS - change these values to suit */ HTMLFile='Index' /* What to call the html file, Oh Yes */ SquareSize=100 /* Size of square into which to fit pic */ TNFormat='PNG' /* Thumbnail file format */ TNArgs='INTERLACE=ADAM7'/* Thumbnail file format arguments */ TNExten='png' /* Thumnail file extension */ TNPrefix='TN' /* Thumbnail prefix */ TableColumns=5 /* No. of pics per row */ TableRows=10 /* No. of rows in table in each index file */ TableBorder=1 /* Size of table borders, in pixels */ FilePattern='~('HTMLFile'#?.html|'TN'#?)' /* only change if you understand arexx */ /* set program variables */ nofile=0 /* flag that image can't be loaded */ /* get them files */ REQUEST_MULTIFILE TITLE '"Choose source files..."' PATTERN FilePattern STEM srcfiles. /* Open html file and write basic info */ FILE_SPLIT FILE '"'srcfiles.files.0'"' STEM getpath. /* program counters */ ColumnCount=1 RowCount=1 FileCount=1 /* <<<<<<<< Process each file >>>>>>>> */ do l = 0 to (srcfiles.files.count - 1) /* if start of table create new file */ if ColumnCount=1 & RowCount=1 then do if FileCount=1 then WriteFile=HTMLFile'.html' else do drop WritePathFile WriteFile=HTMLFile||FileCount'.html' end FILE_JOIN PATHPART '"'getpath.pathpart'"' FILEPART WriteFile VAR WritePathFile if open('OutFile',WritePathFile,'w') then do Title='Index of Directory ' getpath.pathpart ' page ' FileCount call writeln('OutFile', '') call writeln('OutFile', '') call writeln('OutFile', '
') call writeln('OutFile', '',
' | '||, filesplit.filepart'"') nofile=0 end /* <<<<<<<< Inc Column counter and test for end of rows etc >>>>>>>> */ ColumnCount=ColumnCount+1 if ColumnCount > TableColumns then do call writeln('OutFile',' |
') /* if not first file add 'prev' link */ if FileCount=2 then call writeln('OutFile', '[Prev]') if FileCount>2 then call writeln('OutFile', '[Prev]') if l < srcfiles.files.count then call writeln('OutFile', '[Next]') call writeln('OutFile', '
') /* if not first file add 'prev' link */ if FileCount=2 then call writeln('OutFile', '[Prev]') if FileCount>2 then call writeln('OutFile', '[Prev]') call writeln('OutFile', '